/**
 *
 * Copyright (c) 2014-2016 All Rights Reserved.
 */
package org.tinygroup.workflowdemo.integration.impl;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.tinygroup.workflow.integration.inter.WorkflowUserHandler;

/**
 * 
 * @author zhangliang08072
 * @version $Id: UserHandlerImpl.java, v 0.1 2016年5月26日 下午3:47:42 zhangliang08072 Exp $
 */
public class WorkflowUserHandlerImpl implements WorkflowUserHandler<String> {
	private static Map<String,String> userMap;
	static {
		userMap = new HashMap<String,String>();
		userMap.put("userA", "用户A");
		userMap.put("userB", "用户B");
		userMap.put("userC", "用户C");
		userMap.put("userD", "用户D");
		userMap.put("userE", "用户E");
		userMap.put("userF", "用户F");
		userMap.put("userG", "用户G");
	}
	
	private String userId;
	private String userName;
	
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/** 
	 * @see org.tinygroup.foundation.base.user.UserHandler#getCurrentUserId()
	 */
	public String getCurrentUserId(HttpSession session) {
		return (String)session.getAttribute("userId");
	}

	/** 
	 * @see org.tinygroup.foundation.base.user.UserHandler#getCurrentUserName()
	 */
	public String getCurrentUserName(HttpSession session) {
		return (String)session.getAttribute("userName");
	}

	/** 
	 * @see org.tinygroup.foundation.base.user.UserHandler#getCurrentUserInfo()
	 */
	public Map<String, Object> getCurrentUserInfo(HttpSession session) {
		// TODO Auto-generated method stub
		return null;
	}

	/** 
	 * @see org.tinygroup.foundation.base.user.UserHandler#getUserName(java.io.Serializable)
	 */
	public String getUserName(String userId) {
		// TODO Auto-generated method stub
		return userMap.get(userId);
	}

	/** 
	 * @see org.tinygroup.foundation.base.user.UserHandler#getUserInfo(java.io.Serializable)
	 */
	public Map<String, Object> getUserInfo(String userId) {
		// TODO Auto-generated method stub
		return null;
	}

	/** 
	 * @see org.tinygroup.foundation.base.user.UserHandler#getUserIdByUserAccount(java.lang.String)
	 */
	public String getUserIdByUserAccount(String userAccount) {
		// TODO Auto-generated method stub
		return null;
	}

}
